INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)

# Dialog plugin
SET(DIALOG_SOURCES dialog.c ${CMAKE_SOURCE_DIR}/libmariadb/get_password.c)
IF(WIN32)
  SET(DIALOG_SOURCES ${DIALOG_SOURCES} ${CMAKE_SOURCE_DIR}/plugins/plugin.def)
ENDIF()
ADD_LIBRARY(dialog SHARED ${DIALOG_SOURCES})
SET_TARGET_PROPERTIES(dialog PROPERTIES PREFIX "")

INSTALL(TARGETS
          dialog
          RUNTIME DESTINATION "${PLUGIN_INSTALL_DIR}"
          LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}"
          ARCHIVE DESTINATION "${PLUGIN_INSTALL_DIR}")

# Cleartext
# Dialog plugin
SET(CTEXT_SOURCES mariadb_cleartext.c)
IF(WIN32)
  SET(CTEXT_SOURCES ${CTEXT_SOURCES} ${CMAKE_SOURCE_DIR}/plugins/plugin.def)
ENDIF()
ADD_LIBRARY(mysql_clear_password SHARED ${CTEXT_SOURCES})
SET_TARGET_PROPERTIES(mysql_clear_password PROPERTIES PREFIX "")

INSTALL(TARGETS
          mysql_clear_password
          RUNTIME DESTINATION "${PLUGIN_INSTALL_DIR}"
          LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}"
          ARCHIVE DESTINATION "${PLUGIN_INSTALL_DIR}")

# Cleartext
